﻿using System;
using UnityEngine;

// Token: 0x02000296 RID: 662
public class AIRaygunProjectile : RaygunProjectile
{
	// Token: 0x06000EB6 RID: 3766 RVA: 0x00070BCC File Offset: 0x0006EDCC
	protected override void Start()
	{
		base.Start();
		this.audioSource.clip = SoundManager.This.GetNpcRaygunProjectileImpactSound();
		this.lifeTime = (float)GlobalPreferences.AIProjectileLifetime.value;
		this.createImpactParticles = GlobalPreferences.AIProjectileImpactParticles.value;
		this.particlesScaleMult = GlobalPreferences.AIProjectileImpactParticlesSizeMult.value;
		base.SetupAILayerMask();
	}

	// Token: 0x06000EB7 RID: 3767 RVA: 0x00070C2C File Offset: 0x0006EE2C
	public void Initialize(EntityBase shooter, float projectileSpeedMultiplier, float scale)
	{
		Color color = new Color(GlobalPreferences.AIRaygunColorR.value, GlobalPreferences.AIRaygunColorG.value, GlobalPreferences.AIRaygunColorB.value);
		this.Initialize(shooter, projectileSpeedMultiplier, scale, color);
	}

	// Token: 0x06000EB8 RID: 3768 RVA: 0x00070C68 File Offset: 0x0006EE68
	public void Initialize(EntityBase shooter, float projectileSpeedMultiplier, float scale, Color color)
	{
		this.shooter = shooter;
		this.baseSpeed = 20f * projectileSpeedMultiplier * scale;
		base.transform.localScale *= scale * 2.5f;
		this.SetColor(color, 1f);
	}

	// Token: 0x06000EB9 RID: 3769 RVA: 0x00070CB5 File Offset: 0x0006EEB5
	protected override void Impact(GameObject hitObject)
	{
		if (hitObject != null && hitObject.layer != Layers.mapLayer)
		{
			EventManager.SendEvent(new AIRaygunHitEvent(this.shooter, hitObject.GetComponent<EntityBase>()));
		}
		base.Impact(hitObject);
	}

	// Token: 0x040013BE RID: 5054
	private EntityBase shooter;
}
